package cn.trasen.his.poc.std.api.model.inpatient;

import cn.trasen.his.poc.std.api.emums.InfantFlagEnum;
import cn.trasen.his.poc.std.api.emums.SexTypeEnum;
import cn.trasen.his.poc.std.api.model.major.DeptInfo;
import cn.trasen.his.poc.std.api.model.major.HospInfo;
import cn.trasen.his.poc.std.api.model.major.OrgInfo;
import pro.shushi.pamirs.boot.base.ux.annotation.field.UxWidget;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxDetail;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxForm;
import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.IdModel;

/**
 * @Description: 住院病人登记表实体
 * @author: Jacob
 * @Date: 2024-12-6 13:47:02
 * @Company: 湖南创星科技股份有限公司
 */
// 模型中UX开头的注解(UxForm/UxTable/UxDetail等)可以不用写，都可在设计器中进行可视化配置; 代码里面写这些注解是为了默认页面的交互
@UxForm(grid = 3)
@UxDetail(grid = 3)
@Model.model(VisitRecord.MODEL_MODEL)
@Model(displayName = "就诊信息", summary = "就诊信息即病人登记，模拟挂号生成一条就诊数据", labelFields = "patientName")
public class VisitRecord extends IdModel {

    public static final String MODEL_MODEL = "ts.his.VisitRecord";

    @Field.many2one
    @Field.Relation(relationFields = {"orgCode"}, referenceFields = {"code"})
    @Field(displayName = "机构", required = true)
    private OrgInfo org;

    @Field.String
    @Field(displayName = "机构代码", invisible = true)
    private String orgCode;

    @Field.many2one
    @Field.Relation(relationFields = {"hospCode"}, referenceFields = {"hospCode"})
    @Field(displayName = "院区", required = true)
    private HospInfo hospInfo;

    @Field.String
    @Field(displayName = "院区代码", invisible = true)
    private String hospCode;

    @Field.String
    @Field(displayName = "身份证", required = true)
    private String idCard;

    @Field.String
    @Field(displayName = "患者姓名", required = true)
    private String patientName;

    @Field.Enum
    @Field(displayName = "性别", required = true)
    private SexTypeEnum sex;

    @Field.String
    @Field(displayName = "年龄", required = true)
    private String age;

    @Field.String
    @Field(displayName = "联系方式", required = true)
    private String phone;

    @Field.many2one
    @Field.Relation(relationFields = {"deptId"}, referenceFields = {"id"}, domain = "deptType =='KE_SHI'")
    @Field(displayName = "科室名称", required = true)
    private DeptInfo deptName;

    @Field.Integer
    @Field(displayName = "科室ID", invisible = true)
    private Long deptId;

    @Field.String
    @Field(displayName = "家庭地址")
    private String address;

    @Field.String
    @Field(displayName = "医保类型")
    private String medicType;

    @Field.Enum
    @Field(displayName = "人员类型", required = true)
    private InfantFlagEnum infantFlag;

    @Field.String
    @UxForm.FieldWidget(@UxWidget(invisible = "activeRecord.infantFlag!='BABY'"))
    @UxDetail.FieldWidget(@UxWidget(invisible = "activeRecord.infantFlag!='BABY'"))
    @Field(displayName = "婴儿编号")
    private String infantNum;

    @Field.String
    @Field(displayName = "诊断", required = true)
    private String curDiagnosisName;
}
